using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerState_TopMove : PlayerState_TopBase
{
    public PlayerState_TopMove(StateMachine stateMachine, Player player, string animName) : base(stateMachine, player, animName)
    {

    }
    public override void OnUpdate()
    {
        base.OnUpdate();
        if (player.MoveInput.magnitude == 0)
            stateMachine.SwitchState(player.PlayerTopIdleState);

        if (player.PlayerInput.Player.Jump.WasPressedThisFrame())
            stateMachine.SwitchState(player.PlayerTopJumpState);
    }
    public override void OnFixedUpdate()
    {
        base.OnFixedUpdate();
        player.SetVelocity(player.MoveInput.x * player._topmoveSpeed, rb.velocity.y);
    }
}
